﻿<%@ Page Language="C#"  EnableEventValidation = "false"  AutoEventWireup="true" CodeBehind="ZhuangCheDan.aspx.cs" Inherits="syc.Sale.ZhuangCheDan" %>
<%@ Import Namespace="syc.DAL.Sale" %>
<%@ Import  Namespace="syc.Model" %>
<head runat="server">
    <title></title>
</head>
<body>
 <script type="text/javascript" language="javascript" src="/common.js"></script>
    <form id="form1" runat="server">
   <asp:Panel ID="Panel0" runat="server" CssClass="panel">
       <div class="wintop" >产品装车单</div>
    </asp:Panel>   
    <asp:Panel ID="Panel1" runat="server" CssClass="panel">
        
        发运日期：</td><td><span lang="zh-cn">
                <asp:TextBox ID="RiQi" runat="server" CssClass="intxt1" Width="110px"></asp:TextBox>
                <img align="middle" alt="" 
                    onclick="makecalendar(document.getElementById('RiQi').value, document.getElementById('RiQi'));" 
                    src="/Icons/29.png" /></span>
        收货单位：<asp:DropDownList ID="Saler" runat="server" 
            DataSourceID="SqlDataSource1" DataTextField="名称" DataValueField="名称" 
            onselectedindexchanged="Saler_SelectedIndexChanged">
        </asp:DropDownList>
        
            <asp:Button ID="select" runat="server" CssClass="wsbutton" 
                onclick="Button_Query_Click" Text="筛 选" UseSubmitBehavior="False" />
        
        <asp:Button ID="Button_Print"
            runat="server" Text="打印" CssClass="button" UseSubmitBehavior="False" 
            onclick="Button_Print_Click"  />
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server" CssClass="panel2" Width="1000px">
            <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
    </asp:Panel>
    <script>        putBillHead();</script>
   <h4 align="center">陕西延长石油材料有限责任公司</h4>									
    <h2 align="center">产  品  装  车  单	</h2>															
     <table border="1" cellpadding="0" cellspacing="0" style="font-size: 14px" align="center"> 
     <tr>
     <td>
         收货单位：陕西延长石油材料有限公司--<asp:Label ID="Label1" runat="server" Visible="TRUE"></asp:Label>
         <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
             ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
             SelectCommand="SELECT [ID], [名称] FROM [产品订货单位]"></asp:SqlDataSource>
         </td><td>发货单位：陕西延长石油材料有限责任公司</td>				
     </tr>
<tr><td>收货人：</td><td>发货人:<asp:TextBox ID="TextBox1" runat="server" Width="53px"></asp:TextBox>
    <asp:Label ID="Label2" runat="server" Visible="False"></asp:Label>
    </td>	</tr>								
<tr><td>电话（传真）：</td>	<td>电话（传真）：029-84622219	</td></tr>									
	<tr><td ></td><td class="style1">API证书号：5CT-0815	</td></tr> 									
<tr><td colspan="2" style="font-size: 14px" >关于：我公司于<%if (this.RiQi.Text!="")
                                               {%>
                                               
                                                         <%=DateTime.Parse(this.RiQi.Text).Year%>年<%=DateTime.Parse(this.RiQi.Text).Month%>月<%=DateTime.Parse(this.RiQi.Text).Day%>日发往贵公司<%=new SaleInfo().GetChukuCount(DateTime.Parse(this.RiQi.Text), this.Saler.Text)%>
                                               <%}%>车套管，具体明细见下表。望收到后请核对，如有问题请及时给予回复，谢谢合作！</td>
    </tr>
    <tr>
      <td colspan="2">      
         <table style="width:100%; font-size:100px" border="1" cellpadding="0" cellspacing="0">
            <tr style="font-size:15px;">
               <td style="width:6%">序号</td>
               <td style="width:9%">发运时间</td>
               <td style="width:8%">合同号</td>
               <td style="width:6%">到站</td>
               <td style="width:6%">品名</td>
               <td style="width:6%">规格</td>
               <td style="width:6%">钢级</td>
               <td style="width:7%">捆编号</td>
               <td style="width:9%">整车捆数</td>
               <td style="width:9%">整车支数</td>
               <td style="width:9%">整车吨位</td>
               <td style="width:9%">整车米数</td>
               <td>车号</td>
            </tr>
             <%
               // String strCustomerName = "";
                SaleInfo dal = new SaleInfo();
                int 捆数 = 0;
                int 整车支数 = 0;
                float 整车吨位 = 0;
                float 整车米数 = 0;
                int i=0;
                string riqi=this.RiQi.Text;
                if (riqi != "")
                {
                    foreach (产品出库清单 ck in dal.GetChukuAll(DateTime.Parse(riqi), this.Saler.Text))
                    {
                        捆数 = 捆数 + int.Parse(ck.整车捆数.ToString());
                        整车支数 = 整车支数 + int.Parse(ck.整车支数.ToString());
                        整车吨位 = 整车吨位 + float.Parse(ck.整车吨位.ToString());
                        整车米数 = 整车米数 + float.Parse(ck.整车米数.ToString());
                        if (i < dal.GetChukuCount(DateTime.Parse(riqi), this.Saler.Text))
                        {%>
               <tr style="font-size:12px;">
               <td style="width:3%"><%=i + 1%></td>
               <td style="width:9%"><%=DateTime.Parse(riqi).ToString().Substring(0, 10)%></td>
               <td style="width:8%">&nbsp;</td>
               <td style="width:6%"><%=ck.发往单位%></td>
               <td style="width:6%"><%=ck.品名%></td>
               <td style="width:6%"><%=ck.规格%></td>
               <td style="width:6%">钢级</td>
               <td style="width:6%">见质保书</td>
               <td style="width:9%"><%=ck.整车捆数%></td>
               <td style="width:9%"><%=ck.整车支数%></td>
               <td style="width:9%"><%=ck.整车吨位%></td>
               <td style="width:9%"><%=ck.整车米数%></td>
               <td><%=ck.车号%></td>
            </tr>           
                <%}
                        i = i + 1;
                    }
                }
            %>
              <tr style="font-size:12px;">
               <td style="width:3%">&nbsp;</td>
               <td style="width:9%">合计</td>
               <td style="width:8%">&nbsp;</td>
               <td style="width:6%">&nbsp;</td>
               <td style="width:6%">&nbsp;</td>
               <td style="width:6%">&nbsp;</td>
               <td style="width:6%">&nbsp;</td>
               <td style="width:6%">&nbsp;</td>
               <td style="width:9%"><%=捆数 %></td>
               <td style="width:9%"><%=整车支数%></td>
               <td style="width:9%"><%=整车吨位 %></td>
               <td style="width:9%"><%=整车米数%></td>
               <td>&nbsp;</td>
               </tr>
             <tr>
              <td colspan="13" style="font-size:15px">部门主管：<asp:TextBox ID="txt2" runat="server" 
                      Width="53px"></asp:TextBox>
    &nbsp;<asp:Label ID="lbl3" runat="server" Visible="False"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;经办人：<asp:TextBox 
                      ID="txt3" runat="server" Width="53px" ></asp:TextBox>
    &nbsp;<asp:Label ID="lbl4" runat="server" Visible="False"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;承运人： 
                  <asp:TextBox ID="txt4" runat="server" Width="53px"></asp:TextBox>
    &nbsp;<asp:Label ID="lbl5" runat="server" Visible="False"></asp:Label>
&nbsp;</td>
            </tr>
         </table>
      </td>
    </tr>
    </table> 
    <br />
    </form>
 <script>          putBillFoot();</script>
</body>
</html>
